<style>
    .campaign-in-progress-header{
        float: left;
        width: 100%;
        margin-bottom: 10px;
    }

    .campaign-in-progress-header .btn{
        float: right;
        background: #e67e22;
    }
</style>
<div class="col-management">
    <div class="col-management-header">
        <h3>Survey</h3>
    </div>
    <div class="col-management-body">
        <div class="campaign-in-progress-header">
            <input class="btn" onclick="newCampaign();" type="button" value="New Campaign">
        </div>
        <div class="table-campaign-in-progress">
            <table class="table">
                <tr class="table-header">
                    <td>Campaign ID</td>
                    <td>Campaign Name</td>
                    <td>Date Started</td>
                    <td>Date Ended</td>
                    <td>Option</td>
                </tr>
                <?php
                foreach($campaign as $value){
                    ?>
                    <tr>
                        <td><?php echo $value['cid']; ?></td>
                        <td>
                            <a title="<?php echo $value['campaign_title']; ?>" href="">
                                <?php
                                if(strlen($value['campaign_title'])> 50){
                                    echo mb_substr(strip_tags(html_entity_decode($value['campaign_title'], ENT_QUOTES, 'UTF-8')),0, 50, 'UTF-8')."...";
                                }else{
                                    echo $value['campaign_title'];
                                }
                                ?>
                            </a>
                        </td>
                        <td><?php echo $value['campaign_start_time']; ?></td>
                        <td><?php echo $value['campaign_end_time']; ?></td>
                        <td>
                            <!--<input class="btn" type="button" value="Edit">
                            <input class="btn" type="button" value="View Buzz">-->
                        </td>
                    </tr>
                <?php
                }
                ?>
            </table>
            <!--<div class="pagination">
                <ul>
                    <li><a href="">Prev</a></li>
                    <li class="active"><a href="">1</a></li>
                    <li><a href="">2</a></li>
                    <li><a href="">3</a></li>
                    <li><a href="">Next</a></li>
                </ul>
            </div>-->
        </div>
    </div>
</div>


<script>

    function newCampaign(){
        window.location.href = Root_url+"management#createcampaign";
    }

</script>